package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * version 1.0.0
 * 页面的控制器
 * @author KKW
 * @date 2017/7/7.
 */
@Controller
public class PageController {

    /**
     * RequestMapping匹配跳转路径，return返回的是视图的文件名，不包括后缀
     * @return
     */
    @RequestMapping(value = "/home")
    public String home(){
        return "home";
    }

    @RequestMapping(value = "/mvcDemo")
    public String mvcDemo(){
        return "mvcDemo";
    }

    @RequestMapping(value = "/login")
    public String login(){
        return "login";
    }

    @RequestMapping(value = "/news")
    public String news(){
        return "news";
    }

    @RequestMapping(value = "/hibernateDemo")
    public String hibernateDemo(){
        return "redirect:/newsPage";
    }

    @RequestMapping(value = "/cacheDemo")
    public String cacheDemo(){
        return "cacheDemo";
    }

    @RequestMapping(value = "/urlLog")
    public String urlLog(){
        return "urlLog";
    }

    @RequestMapping(value = "/securityDemo/private")
    public String secPrivate(){
        return "private/info";
    }

    @RequestMapping(value = "/securityDemo/public")
    public String secPublic(){
        return "public/info";
    }

    @RequestMapping(value = "/success")
    public String success(){
        return "success";
    }

    @RequestMapping(value = "/failure")
    public String failure(){
        return "failure";
    }

    @RequestMapping(value = "/securityDemo")
    public String secDemo(){
        return "securityDemo";
    }

    @RequestMapping(value = "/queueDemo")
    public String queueDemo(){
        return "queueDemo";
    }

}
